<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>短信项目模板配置</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../../layui/css/iconfont/iconfont.css" rel="stylesheet"
	type="text/css">
<link href="../../layui/css/layui.css" rel="stylesheet" type="text/css">
<link href="../../css/style.css" rel="stylesheet" type="text/css">
<script src="../../layui/layui.js"></script>
<script src="../../js/jquery-1.8.3.js"></script>
<script src="../../js/util.js"></script>
<script src="../../js/html2canvas.js"></script>
<script src="../../js/jquery-ui-1.10.4.custom.min.js"></script>
	<style>
		.stand {
			display: inline-block;
			width: 6px;
			height: 22px;
			background: #007AFF;
		}
		.title {
			width: 80px;
			height: 28px;
			font-size: 20px;
			font-weight: 500;
			color: #434343;
			line-height: 28px;
			margin: 0 10px;
		}
		.tip {
			width: 840px;
			height: 20px;
			font-size: 14px;
			font-weight: 400;
			color: #1A90D7;
			line-height: 20px;
			transform: scale(0.8);
		}
		.head {
			height: 50px;
			display: flex;
			align-items: center;
		}
		.deploy {
			background: #D8D8D8;
			box-shadow: 0px 0px 8px 0px rgba(124, 124, 124, 0.23);
			border-radius: 8px;
		}
		.hint {
			background: #FDFCEC;
			border-radius: 4px 0px 0px 0px;
			color: #F86E21;
			line-height: 28px;
			font-size: 12px;
		}
		.collocate {
			display: flex;
			color: #FFFFFF;
			line-height: 22px;
			font-size: 16px;
			margin-top: 16px;
            margin-bottom: 40px;
			box-shadow: 0px 0px 8px 0px rgba(124, 124, 124, 0.23);
			padding-top: 20px;
		}
		.phoneContent {
			width: 360px;
			height: 615px;
			margin: 0 40px;
			background: url("../../images/phoneBlack.png") no-repeat;
			background-size: 100% 100%;
			display: flex;
			flex-direction: column;
			align-items: center;
		}
		.showContent {
			background: url("../../images/phone.jpg") no-repeat;
			background-size: 100% 100%;
		}
		.phone {
			width: 330px;
			height: 455px;
			border-radius: 30px;
			display: flex;
			flex-direction: column;
			align-items: center;
			overflow-y: scroll;
			margin-top: 65px;
		}
		.phone::-webkit-scrollbar {
			display: none;
		}
		.layui-layer-page .layui-layer-content::-webkit-scrollbar {
			display: none;
		}
		.unsubscribe {
			padding-left: 20px;
		}
		.unsubscribeShow {
			color: #AEAEAE;
			font-size: 12px;
			width: 100%;
			padding-left: 24px;
			margin-top: 20px;
			box-sizing: border-box;
		}
		.phone .topicalContent {
			width: 82%;
			padding: 7px;
			color: #AEAEAE;
			background: #fff;
			border: 1px solid #dee3e8;
			text-align: center;
			font-size: 12px;
			box-sizing: border-box;
		}
		.phone .signatureContent {
			width: 82%;
			padding: 7px;
			color: #AEAEAE;
			background: #fff;
			border: 1px solid #dee3e8;
			margin-top: 20px;
			text-align: center;
			font-size: 12px;
			box-sizing: border-box;
		}
		.phone .active {
			border-color: #36aaef;
			box-shadow: 0px 0px 4px 0px rgba(16,170,224,0.5);
		}
		.addContent textarea {
			width: 480px;
			height: 220px;
			border: 1px solid #BCBCBC;
			margin-top: 12px;
			color: #C4C4C4;
			font-size: 14px;
			padding: 5px 0 0 10px;
			border-radius: 5px;
		}
		.addContent textarea::placeholder {
			color: #C4C4C4;
			font-size: 14px;
			padding: 0 0 0 2px;
		}
		.matter {
			line-height: 35px;
			letter-spacing: 1px;
			background: url("../../images/message-bg.png") no-repeat;
			background-size: 104px 36px;
			padding-left: 10px;
			font-size: 15px;
		}
		.optionspz {
			display: flex;
			margin-top: 20px;
		}
		.optionspz .text {
			width: 55px;
			color: #7B7B7B;
			font-size: 14px;
			text-align: center;
			margin-top: 4px;
		}
		.optionpz {
			display: inline-block;
			width: 45px;
			height: 45px;
			background: #FFFFFF;
			box-shadow: 0px 0px 4px 0px rgba(184, 184, 184, 0.5);
			border-radius: 8px;
			margin-right: 35px;
			display: flex;
			justify-content: center;
			align-items: center;
		}
		.optionpz img {
			width: 30px;
		}
		.limit {
			font-weight: 600;
			color: #8E8E8E;
			line-height: 28px;
			font-size: 16px;
			margin-top: 20px;
		}
		.limitSize {
			color: #1680F9;
		}
		.topical {
			width: 96px;
			height: 22px;
			font-size: 15px;
			font-weight: 500;
			color: #8E8E8E;
			margin-top: 10px;
		}
		.topicalDetail {
			font-size: 13px;
			color: #8E8E8E;
			line-height: 22px;
		}
		.label {
			color: #E05E49;
		}
		.mesInput {
			width: 480px;
			height: 26px;
			border: 1px solid #BCBCBC;
			border-radius: 8px;
			padding-left: 10px;
		}
		.mesContent {
			position: relative;
			margin-top: 10px;
		}
		.textNum {
			position: absolute;
			right: 26px;
			color: #BCBCBC;
			font-size: 14px;
			top: 3px;
		}
		.setTitle {
			background: #36AAEF;
			letter-spacing: 1px;
			line-height: 35px;
			padding-left: 9px;
			background: url("../../images/message-bg.png") no-repeat;
			background-size: 112px 36px;
			font-size: 15px;
		}
		.layui-form-item {
			color: #333;
		}

		.mesContent input::-webkit-input-placeholder{
			color: #C4C4C4;
			font-size: 14px;
		}
		.mesContent input {
			color: #333;
			font-size: 14px;
		}
		.layui-form-radio>i:hover, .layui-form-radioed>i {
			color: #1680F9;
		}
		.preview {
			width: 480px;
			height: 280px;
			background: #fff;
			margin-top: 15px;
			position: relative;
			text-align: center;
			border: 1px dashed #aeb8c2;
			display: flex;
			align-items: center;
			justify-content: center;
		}
		.preview p {
			color: #333;
			font-size: 14px;
			margin-top: 10px;
		}
		.addPicture, .addVideo, .addFrequency {
			position: relative;
		}
		.filePicture, .fileVideo, .fileFrequency{
			position: absolute;
			width: 20%;
			height: 20%;
			top: 50%;
			left: 50%;
			cursor: pointer;
			transform: translate(-50%, -50%);
		}
		.videoDescribe input::-webkit-input-placeholder{
			color: #C4C4C4;
			font-size: 14px;
		}
		.videoDescribe .describe {
			color: #8E8E8E;
			margin: 10px 0;
			font-size: 14px;
		}
		.videoDescribe input {
			width: 480px;
			height: 26px;
			border: 1px solid #BCBCBC;
			border-radius: 8px;
			padding-left: 10px;
			color: #8E8E8E;
		}
		.phoneText, .videoText, .pictureText, .musicText {
			width: 82%;
			color: #AEAEAE;
			background: #fff;
			border: 1px solid #dee3e8;
			margin-top: 20px;
			text-align: center;
			font-size: 12px;
			flex-grow:0;
			flex-shrink:0;
		}
		.phoneText {
			height: 150px;
		}
		.showContent  .phoneText,
		.showContent  .videoText,
		.showContent  .pictureText,
		.showContent  .musicText {
			overflow: hidden;
			height: 150px;
		}
		.layui-form-checked[lay-skin=primary] i{
			border-color:#597FC0 !important;
			background-color:#FFF !important;
			color:#597FC0 !important;
			font-weight: bold;
		}
		.layui-form-checkbox[lay-skin=primary]:hover i{
			border-color:#597FC0 !important;
		}
		.layui-form-radio>i:hover, .layui-form-radioed>i{
			color: #597FC0 !important;
		}
		.pictureText, .videoText, .musicText {
			line-height: 150px;
		}
		.ylpictureText, .ylvideoText, .ylmusicText {
			line-height: 0;
		}
		.item {
			position: relative;
		}
		.itembg {
			position: absolute;
			left: 0;
			bottom: 0;
			width: 100%;
			height: 100%;
			background: rgba(0,0,0,.6);
			color: #fff;
			z-index: 11;
		}
		.itembg img {
			position: absolute;
			width: 20px;
			height: auto;
			bottom: 8px;
			right: 20px;
			cursor: pointer;
		}
		.addText {
			display: inline-block;
			width: 100%;
			word-break: break-all;
		}
		.layui-form-select dl dd.layui-this {
			background-color: #1E9FFF;
			color: #fff;
		}
        .configOption {
            margin-right: 20px;
        }
		.check {
			background: #1E9FFF;
			color: #fff;
			padding: 6px;
			font-size: 12px;
			border-radius: 10px;
			margin-left: 5px;
			cursor: pointer;
		}
		.phoneBottom {
			color: #333;
			margin-top: 16px;
			font-size: 13px;
		}
		.outputPicture, .outputPictures {
			width: 100%;
			display: flex;
			flex-direction: column;
			align-items: center;
		}
		.showPicture {
			margin: 0;
		}
		.demo-class {
			background-color: transparent!important;
			box-shadow: none!important;
		}
		.ylvideoText {
			position: relative;
		}
		.play {
			position: absolute;
			top: 50%;
			left: 50%;
			transform: translate(-50%, -50%);
			width: 100px;
			height: auto;
		}
        .tip {
			width: 82%;
			color: red;
			font-size: 12px;
			margin-bottom: 10px;
        }
	</style>
<script>
	layui.use([ 'form', 'jquery', 'element', 'laydate', 'layer', 'upload' ], function() {
		var form = layui.form;
		var $ = layui.$;
		var laydate = layui.laydate;
		var layer = layui.layer;
		var upload = layui.upload;
		var step = 1;//用于下一步操作展示隐藏div
		var flagMgr;//判断项目名是否重复
		var copyMgrId="";//被复制项目的Id
		var flagCity;//判断地市是否欠费
		var dutyFlag=0;//获取登录者权限
		var mgrId="";//新增的项目编码
		var sessionCityId = "";
		var mgrNameId;//项目简称id
		var everyDayStartTimeFlag = '00:00:00';
		var everyDayEndTimeFlag = '24:00:00';
		var phoneTextIndex = "";
		var pictureTextIndex = "";
		var videoTextIndex = "";
		var musicTextIndex = "";
		var ip = window.location.host;
		$("#mesTd").hide();
		laydate.render({
	             elem: '#startTime'
	             , type: 'datetime'
	             ,min:minDate()
	        });
	    laydate.render({
	             elem: '#endTime'
	             , type: 'datetime'
	             ,min:minDate(),
	              done: function (value,endDate) {//修改默认时间为23：59：59
                    var hours = endDate.hours;
                    var minutes = endDate.minutes;
                    var seconds = endDate.seconds;
                    if (hours == "0" && minutes == "0" && seconds == "0"){
                        $(".layui-laydate-footer [lay-type='datetime'].laydate-btns-time").click();
                        // 如果是datetime的范围选择，改变开始时间默认值
                        $(".laydate-main-list-0 .layui-laydate-content li ol li:last-child").click();
                        // 改变结束时间默认值
                        $(".laydate-main-list-1 .layui-laydate-content li ol li:last-child").click();
                        // 如果不是范围选择，只是日期时间选择
                        $(".laydate-main-list-0 .layui-laydate-content li ol li:last-child").click();                       
                        $(".layui-laydate-footer [lay-type='date'].laydate-btns-time").click();
                    }                   
                }
	        });    
	        
	    laydate.render({
                elem: '#everyDayStartTime'
                , type: 'time'
                , value: '08:00:00'
                , btns: ['clear', 'confirm']
            });
		laydate.render({
                elem: '#everyDayEndTime'
                , type: 'time'
                , value: '20:00:00'
                , btns: ['clear', 'confirm']
            });    
		laydate.render({
			elem : '#thresholdStartTime'
		});
		laydate.render({
			elem : '#thresholdEndTime'
		});

	    function minDate(){
			    var now = new Date();
			    return now.getFullYear()+"-" + (now.getMonth()+1) + "-" + now.getDate()+" "+now.getHours()+":"+now.getMinutes()+":"+now.getSeconds();
		}
		
		function everyDayStartTime(){
			    var now = new Date();
			    if(dutyFlag==0 || dutyFlag==1){
			    	return "00:00:00";
			    }else{
			    	return "08:00:00";
			    }
		}
		
		function everyDayEndTime(){
			    var now = new Date();
			    if(dutyFlag==0 || dutyFlag==1){
			    	return "24:00:00";
			    }else{
			    	return "20:00:00";
			    }
		}
		
		$('#upload2').on('click', function () {
			confirmSecond2();
			// var choose = $("span.layui-upload-choose").text();
			// console.info(choose);
			// if(choose!=null && choose!=''){
			// 	layer.confirm('确认模板信息无误吗？是否需要再次查看', {
			// 		btn : [ '不需要', '需要' ] //按钮
			// 	}, function() {
			// 		console.info("---1111--");
			// 		$('#uploadFile').trigger("click");
			// 	});
			// }else{
			// 	fileUpload();
			// }
		});

		// $('#upload').on('click', function () {
		// 	var choose = $("span.layui-upload-choose").text();
		// 	if(choose!=null && choose!=''){
		// 		$('#uploadFile').trigger("click");
		// 	}else{
		// 		layer.msg("请先选择要导入的csv文件");
		// 	}
		// });
		$('#upload3').on('click', function () {
			confirmSecond();
			//console.log($("#stationData").val())
		});
		upload.render({
					elem : '#import',
					url : '/template2/modifyByImport',
					auto : false, //关闭自动上传
					accept : 'file', //普通文件
					exts : 'csv', //只允许上传csv文件 //,multiple: true
					bindAction : '#uploadFile',
					before : function() {
						var cityId=$("#cityId").val();
						var mgrType=$("#mgrType").val();
						var startTime=$("#startTime").val();
				        var endTime=$("#endTime").val();
				        var everyDayStartTime=$("#everyDayStartTime").val();
				        var everyDayEndTime=$("#everyDayEndTime").val();
				        var realTime=$("input[name='realTime']:checked").val();
				        var isLocal=$("input[name='isLocal']:checked").val();
				        var isThreshold = 0;
				        //var isCz=$("input[name='isCz']:checked").val();

				        var localIsCz=$("input[name='localIsCz']:checked").val();
	        			var nonLocalIsCz=$("input[name='nonLocalIsCz']:checked").val();

			            $("input:checkbox[name='isThreshold']:checked").each(function () {
			                isThreshold += parseInt($(this).val());
			            });
			            var threshold = $("#threshold").val();
			            var cycleThreshold=0;
			            var cycle;
			            if(isThreshold==2||isThreshold==3){
			               	//cycle=$("#cycle").val();
			               	cycle = $("input[name='cycle']:checked").val();
			                cycleThreshold=$("#cycleThreshold").val();
			            }
			            var content=$("#content").val();
			            var localDate = 7;
			            var isProvince = 0;
			            var nonlocalDate = 7;
			            if(isLocal==1){
			            	isProvince=$("input[name='province']:checked").val();
			            	nonlocalDate=$("input[name='nonlocalDate']:checked").val();
			            }else if(isLocal==2){
			            	//isProvince=1;
			            	isProvince=$("input[name='province']:checked").val();
			            	localDate=$("input[name='localDate']:checked").val();
			            	nonlocalDate=$("input[name='nonlocalDate']:checked").val();
			            }else if(isLocal==0){
			             	localDate=$("input[name='localDate']:checked").val();
			            }
			            var param = {
			            		mgrId: mgrId,
			            		mgrType: mgrType,
			                    startTime: startTime,
			                    endTime: endTime,
			                    everyDayStartTime: everyDayStartTime,
			                    everyDayEndTime: everyDayEndTime,
			                    realTime: realTime,
			                    isLocal: isLocal,
                    			localIsCz: localIsCz,
                    			nonLocalIsCz: nonLocalIsCz,
			                    isThreshold:isThreshold,
			                    threshold:threshold,
			                    cycleThreshold:cycleThreshold,
			                    cycle:cycle,
			                    newContent:'',
			                    localDate: localDate,
			                    nonlocalDate: nonlocalDate,
			                    isProvince: isProvince,
			                    effectTime:startTime,
			                    reset:"0",
			                    flag: "modify",
			                    cityId: cityId,
			                    importType:'importCover'
			                };
			                var json = JSON.stringify(param);
			                console.info("----"+json);
			                	if (isNull(mgrType)) {
						          layer.msg("项目类型不能为空");
						          return false;
						        }
								if (isNull(startTime)) {
						          layer.msg("发送开始时间不能为空");
						          return false;
						        }
						        if (isNull(everyDayStartTime)) {
						          layer.msg("每日发送开始时间不能为空");
						          return false;
						        }
						        if (isNull(everyDayEndTime)) {
						          layer.msg("每日发送结束时间不能为空");
						          return false;
						        }
						        if (isNull(realTime)) {
						          layer.msg("发送实时性不能为空");
						          return false;
						        }
						        if (isNull(isLocal)) {
									layer.msg("号码发送范围不能为空");
									return false;
								}
						        if (""!=endTime && null!=endTime && startTime>=endTime) {
					              layer.msg("发送结束时间不能小于等于开始时间");
					              return false;
					            }
					            if (everyDayStartTime>=everyDayEndTime) {
					              layer.msg("每日发送结束时间不能小于等于每日开始时间");
					              return false;
					            }
						layer.load(); //上传loading
						this.data = param;
					},done : function(obj) {
						console.info(obj);
						layer.closeAll('loading'); //关闭loading
						if (obj.code == 0 && obj.data!=null) {
							var data = obj.data;
							var num = data.toString().split(",");
							layer.confirm('模板添加成功，并成功导入' + data[0] + '个区域,' + data[1] + '个基站', {
								btn: ['确定'] //按钮
							}, function () {
								location.href="smsTemplateManage2.html";
							});
						}
						else{
			               layer.confirm(obj.msg, {
								btn: ['确定'] //按钮
							}, function () {
								layer.close(layer.index);
								//location.href="smsTemplateManage2.html";
							});
			            }
					},
					error : function(index, upload) {
						layer.closeAll('loading'); //关闭loading
						layer.msg("上传过程中出现异常，请重试");
					}
				});

		
		form.on('radio(localDate)', function(data) {
			layer.open({
              content: '号码保存时间将被更改为 '+$("input[name='localDate']:checked").val()+" 天"
              ,btn: ['确定']
            });			
		});
		
		form.on('radio(nonlocalDate)', function(data) {
			layer.open({
              content: '号码保存时间将被更改为 '+$("input[name='nonlocalDate']:checked").val()+" 天"
              ,btn: ['确定']
            });			
		});

		form.on('radio(localDate1)', function(data) {
			if (data.value == 0) {
				$("#province").hide();
				$("#local").show();
				$("#nonlocal").hide();
 				$("#nonLocalIsCz").hide();
/* 				$("#localIsCz").show();  */
				
			} else if(data.value == 1){
				$("#local").hide();
				$("#nonlocal").show();
				$("#province").show();
/* 				$("#localIsCz").hide();*/
				$("#nonLocalIsCz").show(); 
				
				
			} else if(data.value == 2){
				$("#nonlocal").show();
				$("#local").show();
				$("#province").show();
/* 				$("#localIsCz").show();*/
				$("#nonLocalIsCz").show(); 
			}
		});

		//监听第三步中的地市、区县、项目
		//监听区县
            form.on('select(cityId_third)', function (data) {
                var data2 = selectCountyId(data.value);
                appendCountyThird(data2);
                var data1 = selectMgrInfo(data.value);
                appendMgrThird(data1);
            });
			
			 //监听项目
            form.on('select(countyId_third)', function (data) {
	            	if(data.value==null||data.value==''){
	            		var cityId = $("#cityId_third").val();
	            		var data1 = selectMgrInfo(cityId);
	            		appendMgrThird(data1);
	            	}else{
	            		var data1 = selectMgrInfo(data.value);
	                	appendMgrThird(data1);
	            	}
            });
            //动态拼接区县
            function appendCountyThird(data){
                if (data.length != null) {
                    var options = '<option value="">请先选择地市</option>';
                    for (var i = 0; i < data.length; i++) {
                        options += '<option value="' + data[i].countyId + '">' + data[i].countyName + '</option>';
                    }
                    $('#countyId_third').html(options);
                } else {
                    $('#countyId_third').html('该地市下没有区县');
                }
                form.render();
            }
            
            //拼接项目类型
            function appendMgrType(data){
            	if(data.length !=null){
            		var options= '<option value="">请选择</option>';
            		for(var i=0 ; i<data.length ; i++){
            			options += '<option value="' + data[i].typeId + '">' + data[i].typeName + '</option>';
            			$('#mgrType').html(options);
            		}
            	}else{
            		$('#mgrType').html('暂无项目类型');
            	}
            	form.render();
            	
            }
			
			 //动态拼接项目
            function appendMgrThird(data) {
                if (data.length != null) {
                    var options = '<option value="">请选择</option>';
                    for (var i = 0; i < data.length; i++) {
                        options += '<option value="' + data[i].id + '">' + data[i].name + '</option>';
                    }
                    $('#mgrId_third').html(options);
                } else {
                    $('#mgrId_third').html('<option value="">该区县下没有项目</option>');
                }
                form.render();
            }
        //监听第三步中的地市、区县、项目 end
		//监听区县
            form.on('select(cityId)', function (data) {
                var data2 = selectCountyId(data.value);
                appendCounty(data2);
            });
			
			//动态拼接区县
            function appendCounty(data){
                if (data.length != null) {
                    var options = '<option value="">请先选择地市</option>';
                    for (var i = 0; i < data.length; i++) {
                        options += '<option value="' + data[i].countyId + '">' + data[i].countyName + '</option>';
                    }
                    $('#countyId').html(options);
                } else {
                    $('#countyId').html('该地市下没有区县');
                }
                form.render();
            }
			
			 //动态拼接项目
            function appendMgr(data) {
                if (data.length != null) {
                    var options = '<option value="">请选择</option>';
                    for (var i = 0; i < data.length; i++) {
                        options += '<option value="' + data[i].id + '">' + data[i].name + '</option>';
                    }
                    $('#mgrId').html(options);
                } else {
                    $('#mgrId').html('<option value="">该区县下没有项目</option>');
                }
                form.render();
            }
            
            function selectMgrType(){
            	var data;
            	var url='/util/findMgrType';
            	$.ajax({
            		type : 'post',
            		async : false,
            		url : url,
            		success:function(json){
            			data=json.data;
            		},error: function(){
            			layer.msg('系统异常，请联系管理员处理！');
            		}            	
            	});
            	return data;
            }
			
			//根据城市ID查询区县
            function selectCountyId(cityId) {
                var data;
                var url = '/util/findCountyByCityId?cityId=' + cityId;
                $.ajax({
                        type: 'post',
                        async: false,
                        url: url,
                        success: function (json) {
                            data = json.data;
                        }, error: function () {
                            layer.msg('系统异常，请联系管理员处理!');
                        }
                    }
                );
                return data;
            }
			
			//根据城市ID和区县查询项目
            function selectMgrInfo(countyId) {
                var data;
                var url = '/util/findByMgrId?countyId=' + countyId;
                $.ajax({
                        type: 'post',
                        async: false,
                        url: url,
                        success: function (json) {
                            data = json.data;
                        }, error: function () {
                            layer.msg('系统异常，请联系管理员处理!');
                        }
                    }
                );
                return data;
            }
		
		//判断项目名称是否重复
			function judgeMgrName(mgrName){
				var url = '/util/getMgrName';
			    $.ajax({
			            url: url,
			            type: 'post',
			            async: false,
			            data: "mgrName="+mgrName,
			            success: function (json) {
			                flagMgr = json.data;
			            }, error: function () {
			                layer.msg('系统异常，请联系管理员处理!');
			            }
			        }
			    );
		}
		//判断地市是否欠费
		function judgeCity(cityId) {
			var url2 = '/citySign/find';
			var param2 = {
				cityId : cityId,
				page : 1,
				limit : 1
			};
			$.ajax({
				type : 'post',
				data : param2,
				url : url2,
				async : false,
				success : function(obj2) {
					flagCity = obj2.data[0].signId;
				},
				error : function() {
					layer.msg('系统异常，请联系管理员处理!');
				}
			});
		}

		//获取复制的项目ID
		$('#copy').on('click',function(){
		 	copyMgrId = $("#mgrId_third").val();
		 	mgrNameId = $("#mgrName1").val();
			 	if((''!=mgrNameId && null!=mgrNameId)&&(''!=copyMgrId && null!=copyMgrId))
			 	{layer.confirm('项目名称与项目简称只需选择一个', {
						btn: ['确定'] //按钮
					});}else{		 	
			 	if((''!=mgrNameId && null!=mgrNameId)){			
    					var url = '/util/findMgrByName';
    					var param = {
    						mgrName : mgrNameId
    					};
    					$.ajax({
    						type : 'post',
    						async : false,
    						url : url,
    						data : param,
    						success : function(json) {
    							 data = json.data; 
    							 console.log(data.id);	  						
    						 mgrNameId=data.id;	    		
    						},
    						error : function() {
    							layer.msg('系统异常，请联系管理员处理!');
    						}
    					});
    					copyMgrId=mgrNameId;  
    					console.log(copyMgrId); 					
			 	}
			 	layer.confirm('已复制对应基站', {
						btn: ['确定'] //按钮
					});
			 	}		 	
		 });
		
		 $('#next').on('click', function () {

		 	if(step==1) {
					submitFisrt();
		 	}else if(step==2){
				if($(".topicalContent").eq(0).text() == "未添加主题") {
					layer.msg("未添加主题");
					return;
				}else if($(".signatureContent").eq(0).text() == "未添加签名") {
					layer.msg("未添加签名");
					return;
				}else if(Number(parseInt($("#fileSize").text())) > 2048) {
					layer.msg("内容上限为2M，请对短信内容做适当调整");
					return;
				}
		 		submitSecond();
		 	}
		 });

		//查看短信条数

		$('#qryContentCount').on('click', function() {
			$('#contentCount').show();
			var param;
			var content = $("#content").val();
			var url;
			var isThreshold=0;
			$("input:checkbox[name='isThreshold']:checked").each(function() {
				isThreshold += parseInt($(this).val());
			});
			var threshold = $("#threshold").val();
			var cycleThreshold = 0;
			var cycle;
			if (isThreshold == 2 || isThreshold == 3) {
				cycle = $("input[name='cycle']:checked").val();
				cycleThreshold = $("#cycleThreshold").val();
			}

			if(isNull(content)){
            		layer.msg("短信内容为空！");
            		return false;
            	}else{
            		url="/util/contentCount";
            		param={
            			content : content
            		};
            		
            		$.ajax({
            			type: 'post',
	                    data: param,
	                    url: url,
            			 beforeSend: function () {
	                        loading = layer.load(0, {shade: false});
	                    },
	                    success: function (json) {
	                        layer.close(loading);
	                        if (json.code == 0) {
	                        	$("#contentLength").html(content.length);
	                            $("#contentNum").html(json.data);
	                            if(isThreshold==1){
	                            	$("#thresholdNum").html(" , 总计将发送："+(json.data)*threshold+"  条");
	                            }else if(isThreshold==2 &&cycle==1){
	                            	$("#thresholdNum").html(" , 每年将发送："+(json.data)*cycleThreshold+"  条");
	                            }else if(isThreshold==2 &&cycle==2){
	                            	$("#thresholdNum").html(" , 每月将发送："+(json.data)*cycleThreshold+"  条");
	                            }else if(isThreshold==2 &&cycle==3){
	                            	$("#thresholdNum").html(" , 每周将发送："+(json.data)*cycleThreshold+"  条");
	                            }else if(isThreshold==2 &&cycle==4){
	                            	$("#thresholdNum").html(" , 每天将发送："+(json.data)*cycleThreshold+"  条");
	                            }else if(isThreshold==3 &&cycle==1){
	                            	$("#thresholdNum").html(" , 总计将发送："+(json.data)*threshold+"  条 , 每年将发送："+(json.data)*cycleThreshold+"  条");
	                            }else if(isThreshold==3 &&cycle==2){
	                            	$("#thresholdNum").html(" , 总计将发送："+(json.data)*threshold+"  条 , 每月将发送："+(json.data)*cycleThreshold+"  条");
	                            }else if(isThreshold==3 &&cycle==3){
	                            	$("#thresholdNum").html(" , 总计将发送："+(json.data)*threshold+"  条 , 每周将发送："+(json.data)*cycleThreshold+"  条");
	                            }else if(isThreshold==3 &&cycle==4){
	                            	$("#thresholdNum").html(" , 总计将发送："+(json.data)*threshold+"  条 , 每天将发送："+(json.data)*cycleThreshold+"  条");
	                            }	                           	                            
	                        } else {
	                            layer.msg(json.msg);
	                        }
	                    }
            		});
            		
            		$('#contentCount').show();
            	}
            });
            
		function submitFisrt(){
			var cityId=$("#cityId").val();
			sessionCityId = cityId;
			judgeCity(cityId);
			var countyId=$("#countyId").val();
			var name = $("#name").val();
			var mgrType = $("#mgrType").val();
			judgeMgrName(name);
			var startTime=$("#startTime").val();
	        var endTime=$("#endTime").val();
	        
	        var everyDayStartTime=$("#everyDayStartTime").val();
	        var everyDayEndTime=$("#everyDayEndTime").val();
	        var realTime=$("input[name='realTime']:checked").val();
	        var isLocal=$("input[name='isLocal']:checked").val();
	        var localIsCz=$("input[name='localIsCz']:checked").val();
	        var nonLocalIsCz=$("input[name='nonLocalIsCz']:checked").val();
	        
	        var isThreshold = 0;
            $("input:checkbox[name='isThreshold']:checked").each(function () {
                isThreshold += parseInt($(this).val());
            });
            var threshold = $("#threshold").val();
            var cycleThreshold=0;
            var cycle;
            if(isThreshold==2||isThreshold==3){
               	cycle=$("input[name='cycle']:checked").val();
                cycleThreshold=$("#cycleThreshold").val();
            }
            var localDate = 7;
            var isProvince = 0;
            var nonlocalDate= 7;
            if(isLocal==1){
            	isProvince=$("input[name='province']:checked").val();
            	nonlocalDate=$("input[name='nonlocalDate']:checked").val();
            }else if(isLocal==2){
            	isProvince=$("input[name='province']:checked").val();
            	localDate=$("input[name='localDate']:checked").val();
            	nonlocalDate=$("input[name='nonlocalDate']:checked").val();
            }else if(isLocal==0){
             	localDate=$("input[name='localDate']:checked").val();
            }
            var param = {
                    cityId: cityId,
                    countyId: countyId,
                    name: name,
                    mgrType : mgrType,
                    startTime: startTime,
                    endTime: endTime,   
                    everyDayStartTime: everyDayStartTime,
                    everyDayEndTime: everyDayEndTime,
                    realTime: realTime,
                    isLocal: isLocal,
                    localIsCz: localIsCz,
                    nonLocalIsCz: nonLocalIsCz,
                    isThreshold:isThreshold,
                    threshold:threshold,
                    cycleThreshold:cycleThreshold,
                    cycle:cycle,
                    localDate: localDate,
                    nonlocalDate: nonlocalDate,
                    isProvince: isProvince,
                    reset:"0",
                    flag: "insert",
					sendType: "2"
                };
            var index;
            var url='/template2/configure';
            layer.confirm('确认模板信息无误吗？是否需要再次查看', {
				btn : [ '不需要', '需要' ] //按钮
			}, function() {
					$.ajax({
	            		type: 'post',
	                    data: param,
	                    url: url,
	                    async: false,
	                    beforeSend: function () {
	                    	if (isNull(cityId)) {
					          layer.msg("地市选项不能为空");
					          return false;
					        }
					        if(flagCity==2){
				              layer.msg("地市已欠费，无法添加项目");
				              return false;
				            }
					        if (isNull(name)) {
					          layer.msg("项目名称不能为空");
					          return false;
					        }
					        
					        if (isNull(mgrType)) {
						          layer.msg("项目类型不能为空");
						          return false;
						        }
						        
					        if (isNull(startTime)) {
					          layer.msg("发送开始时间不能为空");
					          return false;
					        }
					        if (isNull(everyDayStartTime)) {
					          layer.msg("每日发送开始时间不能为空");
					          return false;
					        }
					        if (isNull(everyDayEndTime)) {
					          layer.msg("每日发送结束时间不能为空");
					          return false;
					        }
					        if (isNull(realTime)) {
					          layer.msg("发送实时性不能为空");
					          return false;
					        }
					        if (isNull(isLocal)) {
					          layer.msg("号码发送范围不能为空");
					          return false;
					        }
					        if (""!=endTime && null!=endTime && startTime>=endTime) {
				              layer.msg("发送结束时间不能小于等于开始时间");
				              return false;
				            }
				            if (everyDayStartTime>=everyDayEndTime) {
				              layer.msg("每日发送结束时间不能小于等于每日开始时间");
				              return false;
				            }
				            if(flagMgr>0){
				              layer.msg("项目名重复，请修改");
				              return false;
				            }
				            if(name.length>20){
				              layer.msg("项目名过长，请修改");
				              return false;
				            }
				            if (!checkRate($("#threshold").val())) {
			                    layer.msg("阀值必须为数字，若无需设置阀值将发送条数恢复成0即可（注意不要勾选阀值的选项）");
			                    return false;
			                }
			                if (!checkRate($("#cycleThreshold").val())) {
			                    layer.msg("阀值必须为数字，若无需设置阀值将发送条数恢复成0即可（注意不要勾选阀值的选项）");
			                    return false;
			                }
                			if (isThreshold < 2 && $("#cycleThreshold").val() > 0) {
			                    layer.msg('短信周期发送量大于0，但并未勾选\'周期短信发送量\',按周期设置阀值不会生效,请修改');
			                    return false;
			                } else if (isThreshold != 1 && isThreshold != 3 && $("#threshold").val() > 0) {
			                    layer.msg('短信发送总条数大于0，但并未勾选\'短信发送总量\',总量阀值设置不会生效,请修改');
			                    return false;
			                } 
				           index = layer.load(1, {shade: [0.1,'#fff'] });
	                    },
	                    success: function (obj) {
	                    	layer.close(index);
	                    	if(obj.code==0){
	                    		layer.confirm('添加成功，点击确定配置短信内容', {
							        btn: ['确定'] //按钮
							    }, function (index) {
							    	mgrId = obj.data;
							    	console.log(mgrId);
							        $("#second").css("display","");
	            				    step = 2;
	            				    $("#cityId").val(cityId);
	            				    $("#cityId").attr("disabled", true);
	            				    var data2 = selectCountyId(cityId);
		                			appendCounty(data2); 
	            				    $("#countyId").val(countyId);
	            				    $("#countyId").attr("disabled", true);
	            				    var data1 = selectMgrInfo(countyId);
	            				    appendMgr(data1);
	            				    $("#name").attr("disabled", true);
	            				    layer.close(index);
							    });
	                    	}else{
	                    		layer.confirm(obj.data, {
							        btn: ['确定'] //按钮
							    }, function () {
							        location.href="smsTemplateManage2.html";
							    });
	                    	}
	                    },
	                    error: function(){
	                    	layer.close(index);
	                    	layer.msg('系统异常，请联系管理员处理!');
	                    }
	            });
			});
		}
		
		function submitSecond(){
			layer.confirm('确认模板信息无误吗？是否需要再次查看', {
				btn : [ '不需要', '需要' ] //按钮
			}, function() {
				var index = layer.load(1, {shade: [0.1,'#fff'] });
				layer.close(index);
				layer.confirm('点击确定配置项目基站', {
					btn: ['确定'] //按钮
				}, function (index) {
					$("#next").css("display","none");
					$("#third").css("display","");
					$("#upload").css("display","");
					layer.close(index);
				});
			});
		}

		function confirmSecond(){
			console.info("submit template");
			if($(".topicalContent").eq(0).text() == "未添加主题") {
				layer.msg("未添加主题");
			}else if($(".signatureContent").eq(0).text() == "未添加签名") {
				layer.msg("未添加签名");
			}else {
				let uploadFileOrderBo = [];
				let j = 2;
				let flag = true;
				for(let i=0;i<$(".item").length-2;i++) {
					if($(".item")[j+i].classList[0] == "phoneText") {
						if($($(".item").eq(i+j).children(0)).text() == "添加文本") {
							layer.msg("有文本项未配置");
							flag = false;
							return
						}else {
							uploadFileOrderBo.push({
								"type": "1",
								"fileName": "",
								"orderId": i,
								"content": $($(".item").eq(i+j).children(0)).text()
							})
						}
					}else if($(".item")[j+i].classList[0] == "pictureText") {
						if($($(".item")[j+i].lastChild).attr("src") == undefined) {
							layer.msg("有图片项未配置");
							flag = false;
							return
						}else {
							let index = $($(".item")[j+i].lastChild).attr("src").lastIndexOf("=");
							uploadFileOrderBo.push({
								"type": "2",
								"fileName": $($(".item")[j+i].lastChild).attr("src").substring(index+1),
								"orderId": i,
								"content": ""
							})
						}
					}else if($(".item")[j+i].classList[0] == "videoText") {
						if($($(".item")[j+i].lastChild).attr("src") == undefined) {
							layer.msg("有视频项未配置");
							flag = false;
							return
						}else {
							let index = $($(".item")[j+i].lastChild).attr("src").lastIndexOf("=");
							uploadFileOrderBo.push({
								"type": "3",
								"fileName": $($(".item")[j+i].lastChild).attr("src").substring(index+1),
								"orderId": i,
								"content": ""
							})
						}
					}else if($(".item")[j+i].classList[0] == "musicText") {
						if($($(".item")[j+i].lastChild).attr("src") == "undefined") {
							layer.msg("有音频项未配置");
							flag = false;
							return
						}else {
							let index = $($(".item")[j+i].lastChild).attr("src").lastIndexOf("=");
							uploadFileOrderBo.push({
								"type": "4",
								"fileName":  $($(".item")[j+i].lastChild).attr("src").substring(index+1),
								"orderId": i,
								"content": ""
							})
						}
					}
				}
				let param = {
					"mgrId": mgrId,
					"topic": $(".topicalContent").eq(0).text().substring(5),
					"signId": $("#signature").val(),
					"uploadFileOrderBo": uploadFileOrderBo
				};
				layer.confirm('确认模板信息无误吗？是否需要再次查看', {
					btn : [ '不需要', '需要' ] //按钮
				}, function() {
					$.ajax({
						type: 'post',
						async: false,
						data: JSON.stringify(param),
						url: '/template/create5GTemplateSync',
						contentType:"application/json;charset=UTF-8",
						success: function (obj) {
							if(obj.retCode==0){
								fileUpload()
							}else{
								layer.msg(obj.msg)
							}
						},
						error: function(){
							layer.close(index);
							layer.msg('系统异常，请联系管理员处理!');
						}
					});
				})
			}
		}

		function confirmSecond2(){
			console.info("submit template");
			if($(".topicalContent").eq(0).text() == "未添加主题") {
				layer.msg("未添加主题");
			}else if($(".signatureContent").eq(0).text() == "未添加签名") {
				layer.msg("未添加签名");
			}else {
				let uploadFileOrderBo = [];
				let j = 2;
				let flag = true;
				for(let i=0;i<$(".item").length-2;i++) {
					if($(".item")[j+i].classList[0] == "phoneText") {
						if($($(".item").eq(i+j).children(0)).text() == "添加文本") {
							layer.msg("有文本项未配置");
							flag = false;
							return
						}else {
							uploadFileOrderBo.push({
								"type": "1",
								"fileName": "",
								"orderId": i,
								"content": $($(".item").eq(i+j).children(0)).text()
							})
						}
					}else if($(".item")[j+i].classList[0] == "pictureText") {
						if($($(".item")[j+i].lastChild).attr("src") == undefined) {
							layer.msg("有图片项未配置");
							flag = false;
							return
						}else {
							let index = $($(".item")[j+i].lastChild).attr("src").lastIndexOf("=");
							uploadFileOrderBo.push({
								"type": "2",
								"fileName": $($(".item")[j+i].lastChild).attr("src").substring(index+1),
								"orderId": i,
								"content": ""
							})
						}
					}else if($(".item")[j+i].classList[0] == "videoText") {
						if($($(".item")[j+i].lastChild).attr("src") == undefined) {
							layer.msg("有视频项未配置");
							flag = false;
							return
						}else {
							let index = $($(".item")[j+i].lastChild).attr("src").lastIndexOf("=");
							uploadFileOrderBo.push({
								"type": "3",
								"fileName": $($(".item")[j+i].lastChild).attr("src").substring(index+1),
								"orderId": i,
								"content": ""
							})
						}
					}else if($(".item")[j+i].classList[0] == "musicText") {
						if($($(".item")[j+i].lastChild).attr("src") == "undefined") {
							layer.msg("有音频项未配置");
							flag = false;
							return
						}else {
							let index = $($(".item")[j+i].lastChild).attr("src").lastIndexOf("=");
							uploadFileOrderBo.push({
								"type": "4",
								"fileName":  $($(".item")[j+i].lastChild).attr("src").substring(index+1),
								"orderId": i,
								"content": ""
							})
						}
					}
				}
				let param = {
					"mgrId": mgrId,
					"topic": $(".topicalContent").eq(0).text().substring(5),
					"signId": $("#signature").val(),
					"uploadFileOrderBo": uploadFileOrderBo
				};
				$.ajax({
					type: 'post',
					async: false,
					data: JSON.stringify(param),
					url: '/template/create5GTemplateSync',
					contentType:"application/json;charset=UTF-8",
					success: function (obj) {
						if(obj.retCode==0){
							var choose = $("span.layui-upload-choose").text();
							console.info(choose);
							if(choose!=null && choose!=''){
								$('#uploadFile').trigger("click");
							}else{
								fileUpload();
							}
						}else{
							layer.msg(obj.msg)
						}
					},
					error: function(){
						layer.close(index);
						layer.msg('系统异常，请联系管理员处理!');
					}
				});

			}
		}




		$('#upload').on('click', function () {
			confirmSecond();
			console.log("ccc")
		});
		
		function fileUpload(){
			var mgrType =$("#mgrType").val();
			var startTime=$("#startTime").val();
	        var endTime=$("#endTime").val();
	        var everyDayStartTime=$("#everyDayStartTime").val();
	        var everyDayEndTime=$("#everyDayEndTime").val();
	        var realTime=$("input[name='realTime']:checked").val();
	        var isLocal=$("input[name='isLocal']:checked").val();
			var localIsCz=$("input[name='localIsCz']:checked").val();
	        var nonLocalIsCz=$("input[name='nonLocalIsCz']:checked").val();
	        var isThreshold = 0;
            $("input:checkbox[name='isThreshold']:checked").each(function () {
                isThreshold += parseInt($(this).val());
            });
            var threshold = $("#threshold").val();
            var cycleThreshold=0;
            var cycle;
            if(isThreshold==2||isThreshold==3){
               	cycle=$("input[name='cycle']:checked").val();
                cycleThreshold=$("#cycleThreshold").val();
/*                 if(isThreshold==3){
                	if (cycleThreshold>threshold) {
					          layer.msg("周期阀值不能大于总阀值");
					          return false;
					 }               	
                } */
            }
            var content='5g短信';
            var localDate = 7;
            var isProvince = 0;
            var nonlocalDate = 7;
            if(isLocal==1){
            	isProvince=$("input[name='province']:checked").val();
            	nonlocalDate=$("input[name='nonlocalDate']:checked").val();
            }else if(isLocal==2){
            	//isProvince=1;
            	isProvince=$("input[name='province']:checked").val();
            	localDate=$("input[name='localDate']:checked").val();
            	nonlocalDate=$("input[name='nonlocalDate']:checked").val();
            }else if(isLocal==0){
             	localDate=$("input[name='localDate']:checked").val();
            }
            console.info("====="+mgrId);
            var param = {
            		mgrId: mgrId,
            		mgrType: mgrType,
                    startTime: startTime,
                    endTime: endTime,   
                    everyDayStartTime: everyDayStartTime,
                    everyDayEndTime: everyDayEndTime,
                    realTime: realTime,
                    isLocal: isLocal,
                    localIsCz: localIsCz,
                    nonLocalIsCz: nonLocalIsCz,
                    isThreshold:isThreshold,
                    threshold:threshold,
                    cycleThreshold:cycleThreshold,
                    cycle:cycle,
                    content:content,
                    localDate: localDate,
                    nonlocalDate: nonlocalDate,
                    isProvince: isProvince,
                    effectTime:startTime,
                    reset:"0",
                    flag: "modify",
					sendType: "2"
                };
            var url='/template2/modify';
			$.ajax({
				type: 'post',
				data: param,
				url: url,
				async: false,
				beforeSend: function () {
					if (isNull(mgrType)) {
						layer.msg("项目类型不能为空");
						return false;
					}

					if (isNull(startTime)) {
						layer.msg("发送开始时间不能为空");
						return false;
					}
					if (isNull(everyDayStartTime)) {
						layer.msg("每日发送开始时间不能为空");
						return false;
					}
					if (isNull(everyDayEndTime)) {
						layer.msg("每日发送结束时间不能为空");
						return false;
					}
					if (isNull(realTime)) {
						layer.msg("发送实时性不能为空");
						return false;
					}
					if (isNull(isLocal)) {
						layer.msg("号码发送范围不能为空");
						return false;
					}
					// if (isNull(content)) {
					//   layer.msg("短信内容不能为空");
					//   layer.close(index);
					//   return false;
					// }
					if (""!=endTime && null!=endTime && startTime>=endTime) {
						layer.msg("发送结束时间不能小于等于开始时间");
						return false;
					}
					if (everyDayStartTime>=everyDayEndTime) {
						layer.msg("每日发送结束时间不能小于等于每日开始时间");
						return false;
					}
				},
				success: function (obj) {
					if(obj.code==0 && ''!=copyMgrId && null != copyMgrId){
						var url = '/template2/copyStation';
						var params = {
							copyMgrId:copyMgrId,
							mgrId:mgrId
						};
						$.ajax({
							type: 'post',
							data: params,
							url: url,
							async: false,
							success: function(obj){
								if(obj.data>0){
									layer.confirm('修改成功，并复制'+obj.data+'个基站', {
										btn: ['确定'] //按钮
									}, function () {
										location.href="smsTemplateManage2.html";
									});
								}else{
									layer.confirm('复制项目失败，如需复制项目，请点击确定留在此页面', {
										btn: ['确定','退出'] //按钮
									}, function () {
									}, function () {
										location.href="smsTemplateManage2.html";
									});
								}
							},error: function(){
								layer.msg('系统异常，请联系管理员处理!');
							}
						});
					}/* else if (obj.code==0 && ""!=importStationType && null!=importStationType){

	                    	} */else{
						layer.confirm(obj.data, {
							btn: ['确定'] //按钮
						}, function () {
							location.href="smsTemplateManage2.html";
						});
					}
				},
				error: function(){
					layer.msg('系统异常，请联系管理员处理!');
				}
			});

		}

		$(document).ready(function () {
			$("#upload").css("display","none");
			$("#upload2").css("display","none");
			$("#upload3").css("display","none");
			$("#second").css("display","none");
			$("#third").css("display","none");
			$(".import").css("display","none");
			$("h4").css("display","none");
			$("#local").show();
			//加载项目类型
			var data=selectMgrType();
			appendMgrType(data);
			
			$.ajax({
                    type: 'post',
                    async: false,
                    url: '/util/findUser',
                    success: function (json) {
                        user=json;
                        if (json.duty == 1) {
                        	dutyFlag = 1;
                            $("#cityId").val(json.cityId);
                            $("#cityId").attr("disabled", true);
                            $("#cityId_third").val(json.cityId);
                            $("#cityId_third").attr("disabled", true);
                            var data2 = selectCountyId(json.cityId);
                			appendCounty(data2); 
                			appendCountyThird(data2);
                			var data1 = selectMgrInfo(json.cityId);
                			appendMgrThird(data1);
                            form.render();
                        } else if (json.duty == 2) {
                        	dutyFlag=2;
                        	everyDayStartTimeFlag = '08:00:00';
                        	everyDayEndTimeFlag = '20:00:00';
                            $("#cityId").val(json.cityId);
                            $("#cityId").attr("disabled", true);
                            $("#cityId_third").val(json.cityId);
                            $("#cityId_third").attr("disabled", true);
                            var data2 = selectCountyId(json.cityId);
                			appendCounty(data2); 
                			appendCountyThird(data2);
                            $("#countyId").val(json.countyId);
                            $("#countyId").attr("disabled", true);
                            $("#countyId_third").val(json.countyId);
                            $("#countyId_third").attr("disabled", true);
                            var data1 = selectMgrInfo(json.countyId);
                			appendMgrThird(data1);
                            form.render();
                        }else if (json.duty == 3) {
                        	dutyFlag=3;
                        	everyDayStartTimeFlag = '08:00:00';
                        	everyDayEndTimeFlag = '20:00:00';
                        	$("#add").css("visibility","hidden");
                            $("#cityId").val(json.cityId);
                            $("#cityId").attr("disabled", true);
                            $("#cityId_third").val(json.cityId);
                            $("#cityId_third").attr("disabled", true);
                            var data2 = selectCountyId(json.cityId);
                			appendCounty(data2); 
                			appendCountyThird(data2);
                            $("#countyId").val(json.countyId);
                            $("#countyId").attr("disabled", true);
                            $("#countyId_third").val(json.countyId);
                            $("#countyId_third").attr("disabled", true);
                            var data1 = selectMgrInfo(json.countyId);
                			appendMgrThird(data1);
                            appendMgr(json.list);
                            form.render();
                        }

					                           }, error: function () {
                        layer.msg('系统异常，请联系管理员处理!');
                    }
                });
                $(".importType").click(function(){
                	var importType = $("input[name='importType']:checked").val();
                	if(importType==1){
                		$(".import").css("display","");
	                	$(".copy").css("display","none");
	                	$("#upload2").css("display","");
	                	$("#upload").css("display","none");
						$("#upload3").css("display","none");
                	}else if(importType==2){
	                	$(".import").css("display","none");
	                	$(".copy").css("display","");
	                	$("#upload").css("display","");
	                	$("#upload2").css("display","none");
						$("#upload3").css("display","none");
                	}else if(importType==3) {
						$(".import").css("display","none");
						$(".copy").css("display","none");
						$("#upload").css("display","none");
						$("#upload2").css("display","none");
						$("#upload3").css("display","");


						sessionStorage.setItem("sessionCityId",sessionCityId);

						var url = 'chooseSendRange.html?mgrId='+mgrId;
						layer.open({
						    title: '发送范围选择',
						    type: 2,
						    content: url,
						    area: ['1000px', '550px'],
						    scrollbar: true
						});
						// layer.open({
						// 	type: 2,
						// 	title: '发送范围选择',
						// 	shadeClose: true,
						// 	offset: 'auto',
						// 	shade: 0.8,
						// 	area: ['60%', '50%'],
						// 	content: 'chooseSendRange.html?mgrId='+mgrId //iframe的url
						// });
					}
                });
		});
		$("#mgrName1").autocomplete({
       source : function( request, response ) {
        var key = $("#mgrName1").val();
        var cityId=$("#cityId").val();
        var countyId=$("#countyId").val();
        var url = '/util/selectMgrNameLike';
        var param = {
            cityId : cityId,
            countyId : countyId,
         key : key
        };
                 $.ajax({
         type : 'post',
         async : false,
         url : url,
         data : param,
         success : function(json) {
          var data = json.data;
          source = [];
          for (var i = 0; i < data.length; i++) {
           source[i] = data[i].name;
          }
          console.log(source);
          response( source );
         },
         error : function() {
          layer.msg('系统异常，请联系管理员处理!');
         }
        }
        );
            },
       messages : { //message设置不出现匹配关键字的结果
        noResults : '',
        results : function() {
        }
       }
      });
		//监听提交
		form.on('submit(formDemo)', function(data){
			console.log(data.field);
			return false;
		});

		$(".items").hide();
		$(".addTopical").hide();
		//短信配置项添加
		$(".optionpz").click(function() {
			var optionIndex = $(".optionpz").index(this);
			$(".addTopical").hide();
			$(".addSignature").hide();
			$(".items").hide();
			$(".items").eq(optionIndex).show();
			phoneTextIndex = "";
			pictureTextIndex = "";
			videoTextIndex = "";
			musicTextIndex = "";
			//添加文本
			$(".item").removeClass("active");
			if(optionIndex == 0) {
				$("#messageTextarea").val("");
				$(".phone").eq(0).append("<div class='phoneText item active'><span class='addText'>添加文本</span><div class='itembg' style='display: none'><img class='delete' src='../../images/deleteOption.png' alt=''></div></div>");
				$("#fileSize").text(parseInt($("#fileSize").text()) + 1);
				phoneTextIndex = $(".phoneText").length - 1;
			}else if(optionIndex == 1) {
				$(".phone").eq(0).append("<div class='pictureText item active'><span>上传图片</span><div class='itembg' style='display: none'><img class='delete' src='../../images/deleteOption.png' alt=''></div></div>");
				$(".addPicture").eq(0).html("<i class=\"layui-icon\" style=\"font-size: 30px; color: #333;\">&#xe654;</i>\n" +
						"\t\t\t\t\t\t\t\t\t\t\t\t<p>上传图片</p>");
			}else if(optionIndex == 2) {
				$(".phone").eq(0).append("<div class='videoText item active'><span>上传视频</span><div class='itembg' style='display: none'><img class='delete' src='../../images/deleteOption.png' alt=''></div></div>");
				$(".addVideo").eq(0).html("<i class=\"layui-icon\" style=\"font-size: 30px; color: #333;\">&#xe654;</i>\n" +
						"\t\t\t\t\t\t\t\t\t\t\t\t<p>上传视频</p>");
			}else if(optionIndex == 3) {
				$(".phone").eq(0).append("<div class='musicText item active'><span>上传音频</span><div class='itembg' style='display: none'><img class='delete' src='../../images/deleteOption.png' alt=''></div></div>");
				$(".addFrequency").eq(0).html("<i class=\"layui-icon\" style=\"font-size: 30px; color: #333;\">&#xe654;</i>\n" +
						"\t\t\t\t\t\t\t\t\t\t\t\t<p>上传音频</p>");
			}
			//$(".active")[0].animate({scrollBottom:$(".active")[0].scrollHeight},'1000');
			$(".phone").eq(0).scrollTop(150 * $(".item").length);
		});
		$(".phone").on('click','.item',function() {
			// var pictureTextIndex = 0;
			// var videoTextIndex = 0;
			// var musicTextIndex = 0;
			var type = $(this).attr('class');
			$(".addTopical").hide();
			$(".addSignature").hide();
			if(type.indexOf("phoneText") != -1) {
				phoneTextIndex = $(".phoneText").index(this);
				$(".items").hide();
				$(".items").eq(0).show();
				if($(this).text() == "添加文本") {
					$("#messageTextarea").val("");
				}else {
					$("#messageTextarea").val($(this).text());
				}
			}else if(type.indexOf("pictureText") != -1) {
				pictureTextIndex = $(".pictureText").index(this);
				var pictureSrc = $($(this).children()[1]).attr("src");
				if(pictureSrc) {
					$(".addPicture").eq(0).html("<img src="+"'"+pictureSrc+"'" +"style='max-width: 100%;max-height: 280px'>");
				}else {
					$(".addPicture").eq(0).html("<i class=\"layui-icon\" style=\"font-size: 30px; color: #333;\">&#xe654;</i>\n" +
							"\t\t\t\t\t\t\t\t\t\t\t\t<p>上传图片</p>");
				}
				$(".items").hide();
				$(".items").eq(1).show();
			}else if(type.indexOf("videoText") != -1) {
				videoTextIndex = $(".videoText").index(this);
				var videoSrc = $($(this).children()[1]).attr("src");
				if(videoSrc) {
					$(".addVideo").eq(0).html("<video src="+"'"+videoSrc+"'" +"style='max-width: 100%;max-height: 280px' controls>");
				}else {
					$(".addVideo").eq(0).html("<i class=\"layui-icon\" style=\"font-size: 30px; color: #333;\">&#xe654;</i>\n" +
							"\t\t\t\t\t\t\t\t\t\t\t\t<p>上传视频</p>");
				}
				$(".items").hide();
				$(".items").eq(2).show();
			}else if(type.indexOf("musicText") != -1) {
				musicTextIndex = $(".musicText").index(this);
				var audioSrc = $($(this).children()[1]).attr("src");
				if(audioSrc) {
					$(".addFrequency").eq(0).html("<audio src="+"'"+ audioSrc +"'" +"style='max-width: 350px;max-height:280px;' controls>");
				}else {
					$(".addFrequency").eq(0).html("<i class=\"layui-icon\" style=\"font-size: 30px; color: #333;\">&#xe654;</i>\n" +
							"\t\t\t\t\t\t\t\t\t\t\t\t<p>上传音频</p>");
				}
				$(".items").hide();
				$(".items").eq(3).show();
			}else if(type.indexOf("topicalContent") != -1) {
				if($(".topicalContent").text() != "未添加主题") {
					$(".mesInput").val($(".topicalContent").text().slice(5));
				}
				$(".items").hide();
				$(".addTopical").show();
			}else if(type.indexOf("signatureContent") != -1) {
				$(".items").hide();
				$(".addSignature").show();
				//首先动态存储变量然后通过dom找到select被封装后的位置及元素来设置点击事件
				var currency = 'dd[lay-value=' + $("#signature").val() + ']';
				$('#signature').siblings("div.layui-form-select").find('dl').find(currency).click();
			}
			$(".item").removeClass("active");
			$(this).addClass("active");
		});
		$(".phone").on('mouseover','.item',function() {
			$(this).children(".itembg").css("display", "block");
		});
		//点击添加项删除按钮
		$(".phone").on('click','.delete',function(event) {
			if($(this).parent().next().attr("src")) {
				let index = $(this).parent().next().attr("src").lastIndexOf("=");
				$.ajax({
					type: 'post',
					async: false,
					url: '/upload/delete',
					data: {
						"mgrId": mgrId,
						"filePath": $(this).parent().next().attr("src").substring(index+1)
					},
					success: function (json) {
						console.log(json);
						if(json.retCode == 0) {
							$("#fileSize").text(parseInt($("#fileSize").text()) - parseInt(json.data));
							$(this).parent().parent().remove();
							$(".items").hide();
							event.stopPropagation();
						}else {
							layer.msg(json.msg);
						}
					}.bind(this), error: function () {
						layer.msg('系统异常，请联系管理员处理!');
					}
				});
			}else {
				if($(this).parent().parent().hasClass('phoneText')) {
					$("#fileSize").text(parseInt($("#fileSize").text()) - 1);
				}
				$(this).parent().parent().remove();
				$(".items").hide();
				event.stopPropagation();
			}
		});
		$(".phone").on('mouseleave','.item',function() {
			$(this).children(".itembg").css("display", "none");
		});
		//监听文本内容输入
		$('#messageTextarea').on('input', function(e){
			if(e.delegateTarget.value == "") {
				$(".phoneText").eq(phoneTextIndex).children("span").text("添加文本");
			}else  {
				$(".phoneText").eq(phoneTextIndex).children("span").text(e.delegateTarget.value);
			}
		});
		//添加主题
		$(".topicalContent").eq(0).click(function() {
			$(".items").hide();
			$(".addTopical").show();
		});
		$("#mesInput").blur(function(e) {
			e.delegateTarget.value = e.delegateTarget.value.replace("/","");
			e.delegateTarget.value = e.delegateTarget.value.replace(">","");
			e.delegateTarget.value = e.delegateTarget.value.replace("<","");
			e.delegateTarget.value = e.delegateTarget.value.replace("!","");
			e.delegateTarget.value = e.delegateTarget.value.replace("'","");
			e.delegateTarget.value = e.delegateTarget.value.replace("alert","");
			e.delegateTarget.value = e.delegateTarget.value.replace("../","");
			e.delegateTarget.value = e.delegateTarget.value.replace("./","");
			e.delegateTarget.value = e.delegateTarget.value.replace("script","");
			if(e.delegateTarget.value.trim() == "") {
				$(".topicalContent").eq(0).text("未添加主题");
			}else {
				$(".topicalContent").eq(0).text("短信主题：" + e.delegateTarget.value);
			}
		});
		//视频上传
		// $("#fileVideo").on("change",function(){
		// 	var obj=$("#fileVideo")[0].files[0];
		// 	var fr=new FileReader();
		// 	fr.onload=function () {
		// 		$("#fileVideo").attr('src',this.result);
		// 		console.log(this.result);
		// 		$("#avatar").val(this.result);
		// 	};
		// });
		//图片上传
		upload.render({
            elem: '.uploadPicture' //绑定元素
            ,url: "/upload/templateFile" //上传接口
            ,accept:'images'
            ,exts:'jpg|jpeg|png|bmp|gif'
            ,multiple: true
			,size: 2*1024*1024
			,before: function (obj){
				this.data = {mgrId: mgrId,type: "2"};
				obj.preview(function(index, file, result){
					$("#fileSize").text(parseInt(parseInt(file.size)/1024) + parseInt($("#fileSize").text()));
				});
			}
            ,done: function(res, index, upload){
				let path = $(".addPicture:first-child").children("img").attr("src");
				if(path) {
					let index = path.lastIndexOf("=");
					$.ajax({
						type: 'post',
						async: false,
						url: '/upload/delete',
						data: {
							"mgrId": mgrId,
							"filePath": path.substring(index+1)
						},
						success: function (json) {
							if(json.retCode == 0) {
								$("#fileSize").text(parseInt($("#fileSize").text()) - parseInt(json.data));
							}else {
								layer.msg(json.msg);
							}
						}.bind(this), error: function () {
							layer.msg('系统异常，请联系管理员处理!');
						}
					});
				}
				if(pictureTextIndex === "") {
					$(".pictureText:last").html("<div class='itembg' style='display: none'><img class='delete' src='../../images/deleteOption.png' alt=''></div><img src="+"'http://"+ip+"/servlet/h5imageShowServlet?type=2&fileName="+res.data +"'" +"style='height: 100%;'>");
					$(".addPicture").eq(0).html("<img src="+"'http://"+ip+"/servlet/h5imageShowServlet?type=2&fileName="+res.data +"'" +"style='max-width: 100%;max-height: 280px;'>");
				}else {
					$(".pictureText").eq(pictureTextIndex).html("<div class='itembg' style='display: none'><img class='delete' src='../../images/deleteOption.png' alt=''></div><img src="+"'http://"+ip+"/servlet/h5imageShowServlet?type=2&fileName="+res.data +"'" +"style='height: 100%;'>");
					$(".addPicture").eq(0).html("<img src="+"'http://"+ip+"/servlet/h5imageShowServlet?type=2&fileName="+res.data +"'" +"style='max-width: 100%;max-height: 280px;'>");
				}
            }
            ,error: function(index, upload){
            }
        });
		//视频上传
		upload.render({
			elem: '.uploadVideo' //绑定元素
			,url: "/upload/templateFile" //上传接口
			,accept:'video'
			,size: 2*1024*1024
			// ,exts:'jpg|jpeg|png|bmp|gif'
			,multiple: true
			,before: function (obj){
				this.data = {mgrId: mgrId,type: "3"};
				obj.preview(function(index, file, result){
					$("#fileSize").text(parseInt(parseInt(file.size)/1024) + parseInt($("#fileSize").text()));
				});
			}
			,done: function(res, index, upload){
				let path = $(".addVideo:first-child").children("video").attr("src");
				if(path) {
					let index = path.lastIndexOf("=");
					$.ajax({
						type: 'post',
						async: false,
						url: '/upload/delete',
						data: {
							"mgrId": mgrId,
							"filePath": path.substring(index+1)
						},
						success: function (json) {
							if(json.retCode == 0) {
								$("#fileSize").text(parseInt($("#fileSize").text()) - parseInt(json.data));
							}else {
								layer.msg(json.msg);
							}
						}.bind(this), error: function () {
							layer.msg('系统异常，请联系管理员处理!');
						}
					});
				}
				if(videoTextIndex === "") {
					$(".videoText:last").html("<div class='itembg' style='display: none'><img class='delete' src='../../images/deleteOption.png' alt=''></div><video src="+"'http://"+ip+"/servlet/h5imageShowServlet?type=2&fileName="+res.data +"'" +"style='width: 100%;' controls>");
					$(".addVideo").eq(0).html("<video src="+"'http://"+ip+"/servlet/h5imageShowServlet?type=2&fileName="+res.data +"'" +"style='width: 100%;max-height: 280px;' controls>");
				}else {
					$(".videoText").eq(videoTextIndex).html("<div class='itembg' style='display: none'><img class='delete' src='../../images/deleteOption.png' alt=''></div><video src="+"'http://"+ip+"/servlet/h5imageShowServlet?type=2&fileName="+res.data +"'" +"style='width: 100%;'  controls>");
					$(".addVideo").eq(0).html("<video src="+"'http://"+ip+"/servlet/h5imageShowServlet?type=2&fileName="+res.data +"'" +"style='max-width: 100%;max-height: 280px;' controls>");
				}
			}
			,error: function(index, upload){
			}
		});
		//音频上传
		upload.render({
			elem: '.uploadAudio' //绑定元素
			,url: "/upload/templateFile" //上传接口
			,accept:'audio'
			// ,exts:'jpg|jpeg|png|bmp|gif'
			,size: 2*1024*1024
			,multiple: true
			,before: function (obj){
				this.data = {mgrId: mgrId,type: "4"};
				obj.preview(function(index, file, result){
					$("#fileSize").text(parseInt(parseInt(file.size)/1024) + parseInt($("#fileSize").text()));
				});
			}
			,done: function(res, index, upload){
				let path = $(".addFrequency:first-child").children("audio").attr("src");
				if(path) {
					let index = path.lastIndexOf("=");
					$.ajax({
						type: 'post',
						async: false,
						url: '/upload/delete',
						data: {
							"mgrId": mgrId,
							"filePath": path.substring(index+1)
						},
						success: function (json) {
							if(json.retCode == 0) {
								$("#fileSize").text(parseInt($("#fileSize").text()) - parseInt(json.data));
							}else {
								layer.msg(json.msg);
							}
						}.bind(this), error: function () {
							layer.msg('系统异常，请联系管理员处理!');
						}
					});
				}
				if(musicTextIndex === "") {
					$(".musicText:last").html("<div class='itembg' style='display: none'><img class='delete' src='../../images/deleteOption.png' alt=''></div><audio src="+"'http://"+ip+"/servlet/h5imageShowServlet?type=2&fileName="+res.data +"'" +"style=max-width: 100%;max-height:150px;' controls>");
					$(".addFrequency").eq(0).html("<audio src="+"'http://"+ip+"/servlet/h5imageShowServlet?type=2&fileName="+res.data +"'" +"style='max-width: 350px;max-height:150px;' controls>");
				}else {
					$(".musicText").eq(musicTextIndex).html("<div class='itembg' style='display: none'><img class='delete' src='../../images/deleteOption.png' alt=''></div><audio src="+"'http://"+ip+"/servlet/h5imageShowServlet?type=2&fileName="+res.data +"'" +"style='width: 100%;max-height:150px;' controls>");
					$(".addFrequency").eq(0).html("<audio src="+"'http://"+ip+"/servlet/h5imageShowServlet?type=2&fileName="+res.data +"'" +"style='max-width: 350px;max-height:150px;' controls>");
				}
			}
			,error: function(index, upload){uploadFileOrderBo
			}
		});
		//签名选择
		form.on('select(signature)', function(data){
			if($("#signature option:selected").text() == "请选择") {
				$(".signatureContent").eq(0).html("未添加签名");
				$("#mesTd").hide();
			}else {
				$(".signatureContent").eq(0).html("短信签名：" + $("#signature option:selected").text());
				$("#mesTd").show();
				$("#mesTdNum").text($("#signature option:selected").attr("tdNum"));
			}
		});
		$.ajax({
			type : 'post',
			data :  JSON.stringify({"cityId":$("#cityId").val(),"countyId":$("#countyId").val(),"checkState": "1", "state": "1"}),
			async : false,
			url : "/signatureManage/qrySignatureList2",
			contentType:"application/json;charset=UTF-8",
			success : function(data) {
				//签名下拉框
				if(data.retCode == 0) {
					var signatureOptions= '<option value="">请选择</option>';
					for(var i=0 ; i<data.data.length ; i++){
						signatureOptions += '<option value="' + data.data[i].signId + '" tdNum="' + data.data[i].smsChannelNumber + '">' + data.data[i].signName + '</option>';
						$('#signature').html(signatureOptions);
					}
					form.render();
				}
			},
			complete : function() {},
			error : function(data) {
				layer.msg('系统异常，请联系管理员处理!');
			}
		});
		//点击预览
		$(".check").click(function() {
			if($(".topicalContent").eq(0).text() == "未添加主题") {
				layer.msg('<p style="color:black;background: #fff">未添加主题</p>', {icon: 2,time: 1000});
				return;
			}else if($(".signatureContent").eq(0).text() == "未添加签名") {
				layer.msg('<p style="color:black;background: #fff">未添加签名</p>', {icon: 2,time: 1000});
				return;
			}
			let videos = $(".phone video");
			let videosArray = [];
			for(let i=0;i<videos.length;i++) {
				let video = videos[i];
				let canvas = document.createElement("canvas");
				let img = document.createElement("img");
				let ctx = canvas.getContext("2d");
				canvas.width = video.videoWidth;
				canvas.height = video.videoHeight;
				ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
				img.src = canvas.toDataURL();
				videosArray.push(canvas.toDataURL())
			}
			let j = 2;
			let flag = true;
			let uploadFileOrderBo = [];
			for(let i=0;i<$(".item").length-2;i++) {
				if($(".item")[j+i].classList[0] == "phoneText") {
					if($($(".item").eq(i+j).children(0)).text() == "添加文本") {
						layer.msg('<p style="color:black;background: #fff">有文本项未配置</p>', {icon: 2,time: 1000});
						flag = false;
						return
					}else {
						uploadFileOrderBo.push({
							"type": "1",
							"fileName": "",
							"orderId": i,
							"content": $($(".item").eq(i+j).children(0)).text()
						})
					}
				}else if($(".item")[j+i].classList[0] == "pictureText") {
					if($($(".item")[j+i].lastChild).attr("src") == undefined) {
						layer.msg('<p style="color:black;background: #fff">有图片项未配置</p>', {icon: 2,time: 1000});
						flag = false;
						return
					}else {
						let index = $($(".item")[j+i].lastChild).attr("src").lastIndexOf("=");
						uploadFileOrderBo.push({
							"type": "2",
							"fileName": $($(".item")[j+i].lastChild).attr("src").substring(index+1),
							"orderId": i,
							"content": ""
						})
					}
				}else if($(".item")[j+i].classList[0] == "videoText") {
					if($($(".item")[j+i].lastChild).attr("src") == undefined) {
						layer.msg('<p style="color:black;background: #fff">有视频项未配置</p>', {icon: 2,time: 1000});
						flag = false;
						return
					}else {
						let index = $($(".item")[j+i].lastChild).attr("src").lastIndexOf("=");
						uploadFileOrderBo.push({
							"type": "3",
							"fileName": $($(".item")[j+i].lastChild).attr("src").substring(index+1),
							"orderId": i,
							"content": ""
						})
					}
				}else if($(".item")[j+i].classList[0] == "musicText") {
					if($($(".item")[j+i].lastChild).attr("src") == "undefined") {
						layer.msg('<p style="color:black;background: #fff">有音频项未配置</p>', {icon: 2,time: 1000});
						flag = false;
						return
					}else {
						let index = $($(".item")[j+i].lastChild).attr("src").lastIndexOf("=");
						uploadFileOrderBo.push({
							"type": "4",
							"fileName":  $($(".item")[j+i].lastChild).attr("src").substring(index+1),
							"orderId": i,
							"content": ""
						})
					}
				}
			}
			let content = "";
			let textIndex = 0;
			content = "<div class='topicalContent' style='text-align: left'>"+ $(".topicalContent").eq(0).text().substring(5) +"</div>";
			//content = content + "<div class='signatureContent' style='text-align: left'>【"+ $(".signatureContent").eq(0).text().substring(5) +"】</div>";
			for(let i=0;i<uploadFileOrderBo.length;i++) {
				if(uploadFileOrderBo[i].type == "1") {
					if(textIndex == 0) {
						content += "<div class='phoneText' style='height:auto'><span class='addText' style='text-align: left;padding: 10px;box-sizing: border-box;'>【"+ $(".signatureContent").eq(0).text().substring(5) +"】"+ uploadFileOrderBo[i].content +"</span></div>"
					}else {
						content += "<div class='phoneText' style='height:auto'><span class='addText' style='text-align: left;padding: 10px;box-sizing: border-box;'>"+ uploadFileOrderBo[i].content +"</span></div>"
					}
					textIndex++;
				}else if(uploadFileOrderBo[i].type == "2") {
					content += "<div class='pictureText ylpictureText'><img src="+"'http://"+ip+"/servlet/h5imageShowServlet?type=2&fileName="+ uploadFileOrderBo[i].fileName+"'" +"style='width: 100%'></div>"
				}else if(uploadFileOrderBo[i].type == "4") {
					content += "<div class='musicText ylmusicText'><audio src="+"'http://"+ip+"/servlet/h5imageShowServlet?type=2&fileName="+ uploadFileOrderBo[i].fileName+"'" +"style='width: 100%' controls></div>"
				}else if(uploadFileOrderBo[i].type == "3") {
					content += "<div class='videoText ylvideoText'><video src="+"'http://"+ip+"/servlet/h5imageShowServlet?type=2&fileName="+ uploadFileOrderBo[i].fileName+"'" +"style='width: 100%' controls></div>"
				}
			}
			content = "<div class='phoneContent showPicture'><div class='phone'><div class='outputPicture'>"+content+"</div></div></div>";
			let contents = "";
			let textIndexs = 0;
			contents = "<div class='tip'>注：导出长图仅供参考，实际效果以终端显示为准</div><div class='topicalContent' style='text-align: left;padding: 10px;box-sizing: border-box;'>"+ $(".topicalContent").eq(0).text().substring(5) +"</div>";
			//contents = contents + "<div class='signatureContent' style='text-align: left'>【"+ $(".signatureContent").eq(0).text().substring(5) +"】</div>";
			let k = 0;
			for(let i=0;i<uploadFileOrderBo.length;i++) {
				if(uploadFileOrderBo[i].type == "1") {
					if(textIndexs == 0) {
						contents += "<div class='phoneText' style='height:auto;'><span class='addText' style='text-align: left;padding:10px;height: auto;box-sizing: border-box'>【"+ $(".signatureContent").eq(0).text().substring(5) +"】"+ uploadFileOrderBo[i].content +"</span></div>"
					}else {
						contents += "<div class='phoneText' style='height:auto;'><span class='addText' style='text-align: left;padding:10px;height: auto;box-sizing: border-box'>"+ uploadFileOrderBo[i].content +"</span></div>"
					}
					textIndexs++;
				}else if(uploadFileOrderBo[i].type == "2") {
					contents += "<div class='pictureText ylpictureText'><img src="+"'http://"+ip+"/servlet/h5imageShowServlet?type=2&fileName="+ uploadFileOrderBo[i].fileName+"'" +"style='width: 100%'></div>"
				}else if(uploadFileOrderBo[i].type == "4") {
					contents += "<div class='musicText ylmusicText'><img src='../../images/audio.png' style='width: 100%'></div>"
				}else if(uploadFileOrderBo[i].type == "3") {
					contents += "<div class='videoText ylvideoText'><img class='play' src='../../images/play.png'><img src="+ videosArray[k] +" style='width: 100%'></div>";
					k++;
				}
			}
			//contents = "<div class='phoneContent showPicture'><div class='phone'><div class='outputPictures'>"+contents+"</div></div></div>";
			var layeros = "";
			layer.open({
				type: 1
				,skin: 'demo-class'
				, title: false //不显示标题栏
				, closeBtn: false
				, area: '353px;'
				, shade: 0.8
				, id: 'LAY_layuipro' //设定一个id，防止重复弹出
				, btn: ['导出', '关闭']
				, btnAlign: 'c'
				, moveType: 1 //拖拽模式，0或者1
				, content: content
				, success: function (layero) {
					layeros = layero;
				},btn1: function() {
					//$("body").append("<div>"+ $(".outputPicture").html() +"</div>");
					$(".outputPicture").html(contents);
					var btn = layeros.find('.layui-layer-btn');
					if(!btn.find('.layui-layer-btn0').attr('href')) {
						html2canvas(document.getElementsByClassName("outputPicture")[0], {
							allowTaint: true,
							taintTest: false,
							useCORS: true,
							async: false,
							dpi: 350,
							onrendered: function(canvas) {
								canvas.id = "mycanvas";
								//生成base64图片数据
								var dataUrl = canvas.toDataURL();
								//$("#output").attr("href",dataUrl);
								btn.find('.layui-layer-btn0').attr({
									href: dataUrl
									,download: 'phone.jpeg'
								});
							}
						});
					}
				}
			})
		})
	});
</script>
</head>
<body>
	<!--nav-->
	<div class="layui-html-limit">
		<!--container-->
		<div class="layui-content-body">
			<div class="scroll-box">
				<div class="breadcrumb-box">
					<span class="layui-breadcrumb" lay-separator="|"> <a
						href="javascript:returnIndex2()">首页&nbsp;</a> <a href="">
							&nbsp;短信模板管理&nbsp; </a> <a href="smsTemplateManage2.html">
							&nbsp;短信项目模板配置管理</a> <a href=""> &nbsp;短信项目模板配置&nbsp; </a>
					</span>
				</div>
				<div class="content-box">
					<div class="layui-form layui-form-pane">
						<div class="layui-form-item" id="first">
							<div class="layui-inline">
								<label class="layui-btn layui-btn-lg layui-btn-normal" style="cursor:auto;">第一步：项目基本信息配置</label>
							</div>
							<div class="layui-form-item">
								<div class="layui-inline">
									<label class="layui-form-label">地市</label>
									<div class="layui-input-block" style="width:150px">
										<select name="cityId" lay-filter="cityId" id="cityId">
											<option value="">请选择</option>
											<option value="11">苏州</option>
											<option value="12">淮安</option>
											<option value="13">宿迁</option>
											<option value="14">南京</option>
											<option value="15">连云港</option>
											<option value="16">徐州</option>
											<option value="17">常州</option>
											<option value="18">镇江</option>
											<option value="19">无锡</option>
											<option value="20">南通</option>
											<option value="21">泰州</option>
											<option value="22">盐城</option>
											<option value="23">扬州</option>
											<!-- <option value="25">省级</option> -->
										</select>
									</div>
								</div>
								<div class="layui-inline"><span style="color:red;">*</span></div>
								<div class="layui-inline countyId">
		                            <label class="layui-form-label">区县</label>
		                            <div class="layui-input-block" style="width:150px">
		                                <select name="countyId" lay-filter="countyId" id="countyId">
		                                    <option value="">全部</option>
		                                </select>
		                            </div>
		                        </div>
							</div>
							<div class="layui-form-item">
								<div class="layui-inline">
									<label class="layui-form-label">项目名称</label>
									<div class="layui-input-block">
										<input type="text" name="name" id="name" required
											lay-verify="required" placeholder="请输入项目名称" autocomplete="off"
											class="layui-input">
									</div>
								</div>
								<div class="layui-inline"><span style="color:red;">*(项目名称不可重复，且名称长度不超过20个字)</span></div>
							</div>
							
							<div class="layui-form-item">
								<div class="layui-inline">
									<label class="layui-form-label">项目类型</label>
									<div class="layui-input-block" style="width:184px">
										<select name="mgrType" lay-filter="mgrType" id="mgrType">
										</select>
									</div>
								</div>
								<div class="layui-inline"><span style="color:red;">*</span></div>
							</div>
							
							<div class="layui-form-item">
								<div class="layui-block">
									<label class="layui-form-label" style="width: auto">发送起止时间</label>
									<div class="layui-input-inline">
										<input type="text" name="date" id="startTime"
											autocomplete="off" class="layui-input" placeholder="请选择"
											lay-verify="required">
									</div>
									<div class="layui-form-mid">-</div>
									<div class="layui-input-inline">
										<input type="text" name="date" id="endTime" autocomplete="off"
											class="layui-input" placeholder="请选择">
									</div>
									<div class="layui-inline"><span style="color:red;">*(结束时间默认为23:59:59,并且可以为空,代表永久有效)</span></div>
								</div>
							</div>
							<div class="layui-form-item">
								<div class="layui-block">
									<label class="layui-form-label" style="width:auto">每日发送时间段</label>
									<div class="layui-input-inline">
										<input type="text" name="date" id="everyDayStartTime"
											autocomplete="off" class="layui-input" placeholder="请选择">
									</div>
									<div class="layui-form-mid">-</div>
									<div class="layui-input-inline">
										<input type="text" name="date" id="everyDayEndTime"
											autocomplete="off" class="layui-input" placeholder="请选择">
									</div>
									<div class="layui-inline"><span style="color:red;">*</span></div>
									<!-- <div class="layui-inline">(若想在发送起止时间内连续发送，请将每日发送时间段置为00:00:00至23:59:59)</div> -->
								</div>
							</div>
							<div class="layui-form-item">
								<div class="layui-block" pane="">
									<label class="layui-form-label">发送实时性</label>
									<div class="layui-input-block">
										<input type="radio" name="realTime" value="0" title="立即发送">
										<input type="radio" name="realTime" value="5" title="延迟5分钟发送">
										<input type="radio" name="realTime" value="10" title="延迟10分钟发送">
										<input type="radio" name="realTime" value="20" title="延迟20分钟发送"
											checked="">
											<span style="color:red;">*</span>
									</div>
								</div>
							</div>
							<div class="layui-form-item">
								<div class="layui-block" pane="">
									<label class="layui-form-label" style="width: auto">号码发送范围</label>
									<div class="layui-input-block">
										<input type="radio" name="isLocal" value="0" title="本地"lay-filter="localDate1" checked="checked"> 
										<input type="radio" name="isLocal" value="1" title="外地" lay-filter="localDate1">
										<input type="radio" name="isLocal" value="2" title="本地+外地" lay-filter="localDate1">
											<span style="color:red;">*</span>
									</div>
								</div>
							</div>
							
					<div class="layui-form-item" id="localIsCz" style="display: none">
								<div class="layui-block" pane="">
									<label class="layui-form-label" style="width: auto">本地发送是否屏蔽常驻人口</label>
									<div class="layui-input-block">
										<input type="radio" name="localIsCz" value="0" title="是"lay-filter="localIsCz" > 
										<input type="radio" name="localIsCz" value="1" title="否" lay-filter="localIsCz" checked="checked">
											<span style="color:red;">*</span>
									</div>
								</div>
							</div>
							
							<div class="layui-form-item" id="nonLocalIsCz" style="display: none">
								<div class="layui-block" pane="">
									<label class="layui-form-label" style="width: auto">常驻人口发送范围</label>
									<div class="layui-input-block">
										<input type="radio" name="nonLocalIsCz" value="2" title="常驻"lay-filter="nonLocalIsCz" > 
										<input type="radio" name="nonLocalIsCz" value="0" title="非常驻" lay-filter="nonLocalIsCz" checked="checked">
										<input type="radio" name="nonLocalIsCz" value="1" title="全部" lay-filter="nonLocalIsCz">
											<span style="color:red;">*</span>
									</div>
								</div>
							</div> 
							
							<div class="layui-form-item hiden" id="local"
								style="display: none">
								<div class="layui-block" pane="">
									<label class="layui-form-label" style="width: auto">本地号码保存时间</label>
									<div class="layui-input-block">
										<input type="radio" name="localDate"value="1" title="1天" lay-filter="localDate">
										<input type="radio" name="localDate"value="3" title="3天" lay-filter="localDate">
										<input type="radio" name="localDate"value="5" title="5天" lay-filter="localDate">
										<input type="radio" name="localDate" value="7" title="7天" lay-filter="localDate" checked=""> 
										<input type="radio" name="localDate"value="15" title="15天" lay-filter="localDate"> 
										<input type="radio"name="localDate" value="30" title="30天" lay-filter="localDate"> 
										<input type="radio" name="localDate" value="90" title="90天" lay-filter="localDate">
										<input type="radio" name="localDate" value="180" title="180天" lay-filter="localDate">
										<span style="color:red;">*</span>
									</div>
								</div>
							</div>
							<div class="layui-form-item hiden" id="nonlocal"
								style="display: none">
								<div class="layui-block" pane="">
									<label class="layui-form-label" style="width: auto">外地号码保存时间</label>
									<div class="layui-input-block">
										<input type="radio" name="nonlocalDate"value="1" title="1天" lay-filter="nonlocalDate">
										<input type="radio" name="nonlocalDate"value="3" title="3天" lay-filter="nonlocalDate">
										<input type="radio" name="nonlocalDate"value="5" title="5天" lay-filter="nonlocalDate">
										<input type="radio" name="nonlocalDate" value="7" title="7天" lay-filter="nonlocalDate" checked=""> 
										<input type="radio" name="nonlocalDate" value="15" title="15天" lay-filter="nonlocalDate" > 
										<span style="color:red;">*</span>
									</div>
								</div>
							</div>
							<div class="layui-form-item hiden" id="province"
								style="display: none">
								<div class="layui-block" pane="">
									<label class="layui-form-label" style="width: auto">发送范围选择</label>
									<div class="layui-input-block">
										<input type="radio" name="province" value="0" title="省内" checked="checked"> 
										<input type="radio" name="province" value="1" title="全部"> 
										<span style="color:red;">*</span>
									</div>
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label" style="width: auto">短信发送量阀值设置</label>
								<div class="layui-inline">
									<div class="layui-form-item">
										<div class="layui-inline">
											<input type="checkbox" name="isThreshold" title="短信发送总量"
												value="1">
										</div>
										<div class="layui-inline"><span style="color:red;">*(不设置阀值，短信数量无上限)</span></div>
									</div>
									<div class="layui-form-item">
										<div class="layui-inline" pane="">
											<label class="layui-form-label" style="width: auto">短信发送总条数:</label>
											<div class="layui-input-inline" style="width: auto">
												<input type="text" id="threshold" placeholder="请输入"
													autocomplete="off" class="layui-input" value="0">
											</div>
										</div>
										<div class="layui-inline">条</div>
									</div>
									<div class="layui-form-item">
										<input type="checkbox" name="isThreshold" title="周期短信发送量"
											value="2">
									</div>
									<div class="layui-inline" pane="">
										<input type="radio" name="cycle" value="1" title="按年" checked>
										<input type="radio" name="cycle" value="2" title="按月">
										<input type="radio" name="cycle" value="3" title="按周">
										<input type="radio" name="cycle" value="4" title="按日">
	
	
									</div>
									<div class="layui-form-item">
										<h4 class="tips-h4">
											<i class="iconfont icon-xinxi"></i>
											周发送量不是当天的起，是该周周一开始计算，月发送量就是从当月一号开始算。
										</h4>
									</div>
									<div class="layui-form-item">
										<div class="layui-form-item">
											<div class="layui-inline" pane="">
												<label class="layui-form-label">短信发送量:</label>
												<div class="layui-input-inline" style="width: 100px;">
													<input type="text" placeholder="请输入" id="cycleThreshold"
														autocomplete="off" class="layui-input" value="0">
												</div>
											</div>
											<div class="layui-inline">条</div>
										</div>
									</div>
								</div>
							</div>
						</div>
						
						<div class="layui-form-item layui-form-text" id="second">
							<div class="layui-inline">
								<label class="layui-btn layui-btn-lg layui-btn-normal" style="cursor:auto;">第二步：项目发送内容配置</label>
							</div>
							<br>
<!--							<label class="layui-form-label">短信内容</label>-->
							<div class="head">
								<span class="stand"></span>
								<span class="title">创建短信</span>
<!--								<span class="tip">若您使用的浏览器版本过低而导致影响页面访问时，建议使用简易版，简易版仅支持视频、图片、音频文件快速上传，文本的快速编辑。</span>-->
							</div>
							<div class="deploy">
								<div class="hint">
									建议上传2MB以内的视频文件，【视频格式】为3gp、mp4、amr、mpeg的格式文件；上传时，请添加视频描述信息，不可为空。
								</div>
							</div>
							<div class="collocate" enctype="multipart/form-data">
								<div class="phoneContent showContent">
									<div class="phone">
										<div class="topicalContent item">未添加主题</div>
										<div class="signatureContent item">未添加签名</div>
										<!--            <video src="https://video.mas.10086.cn/materialSource/bebad9b1759109a82b480c3d1e37593d.mp4" controls="controls" width="292"></video>-->
									</div>
									<div class="phoneBottom">
										<span>预计文件大小:</span>
										<span id="fileSize">0</span><span>k</span>
										<span class="check">点击预览</span>
									</div>
								</div>
								<div class="configOption">
									<div class="matter">添加素材</div>
									<div class="optionspz">
										<div>
											<div class="optionpz">
												<img src="../../images/text.png" alt="">
											</div>
											<div class="text">文本</div>
										</div>
										<div>
											<div class="optionpz">
												<img src="../../images/picture.png" alt="">
											</div>
											<div class="text">图片</div>
										</div>
										<div>
											<div class="optionpz">
												<img src="../../images/video.png" alt="">
											</div>
											<div class="text">视频</div>
										</div>
										<div>
											<div class="optionpz">
												<img src="../../images/music.png" alt="">
											</div>
											<div class="text">音频</div>
										</div>
									</div>
									<!--            <div class="size">-->
									<!--                <span>预计文件大小：</span>-->
									<!--                <span>0k</span>-->
									<!--            </div>-->
									<div class="limit">
									<span>
										内容上限为 <span class="limitSize">2M</span>；平台向所有终端设备统一。
									</span>
									</div>
									<div class="addTopical">
										<div class="topical">添加短信主题</div>
										<div class="topicalDetail">
											<div><span class="label">* </span>短信主题将作为短信内容展示，出现在终端的头部；</div>
											<div><span class="label">* </span>视频短信标题允许输入的长度不超过20，且不允许输入如下特殊字符</div>
											<div>/ > < ! '& script../ ./ alert</div>
										</div>
										<div class="mesContent">
											<input class="mesInput" id="mesInput" type="text" placeholder="请输入...,长度不超过20" maxlength="20">
										</div>
									</div>
									<div class="addSignature">
										<div class="topical">添加签名</div>
										<div class="topicalDetail">
											<div style="margin:5px 0;"><span class="label">* </span>视频短信发送必须含签名信息</div>
											<form class="layui-form" action="">
												<div class="layui-form-item">
													<div class="layui-input-block">
														<select name="signature" lay-filter="signature" id="signature">
														</select>
													</div>
												</div>
												<div class="layui-inline" id="mesTd">
													<span>短信通道号：</span>
													<span id="mesTdNum"></span>
												</div>
											</form>
										</div>
									</div>
									<div class="addContent items">
										<div class="topical">添加文本</div>
										<div>
											<textarea name="" id="messageTextarea" cols="30" rows="10" placeholder="请输入短信内容" maxlength="100"></textarea>
										</div>
									</div>
									<div class="addPictures items">
										<div class="topical">添加图片</div>
										<div class="topicalDetail">
											<div><span class="label">* </span>请上传【图片格式】为jpg、jpeg、gif、bmp、png的图片文件</div>
										</div>
										<button type="button" class="layui-btn layui-btn-normal uploadPicture" style="margin-top: 10px;">本地上传</button>
										<div class="preview">
											<div class="addPicture">
												<i class="layui-icon" style="font-size: 30px; color: #333;">&#xe654;</i>
												<p>上传图片</p>
											</div>
											<div class="filePicture uploadPicture"></div>
										</div>
									</div>
									<div class="addVideos items">
										<div class="topical">添加视频</div>
										<div class="topicalDetail">
											<div><span class="label">* </span>建议上传2MB以内的视频文件，【视频格式】为3gp、mp4、amr、mpeg的格式文件。</div>
											<div><span class="label">* </span>上传成功后，服务器将视频自动转码成设备可识别的格式，此过程耗时约30～60秒。</div>
										</div>
										<button type="button" class="layui-btn layui-btn-normal uploadVideo" style="margin-top: 10px;">本地上传</button>
										<div class="preview">
											<div class="addVideo">
												<i class="layui-icon" style="font-size: 30px; color: #333;">&#xe654;</i>
												<p>上传视频</p>
											</div>
											<div class="fileVideo uploadVideo"></div>
										</div>
<!--										<div class="videoDescribe">-->
<!--											<div class="describe">请添加视频描述</div>-->
<!--											<input type="text" placeholder="请输入...">-->
<!--										</div>-->
									</div>
									<div class="addFrequencys items">
										<div class="topical">添加音频</div>
										<div class="topicalDetail">
											<div><span class="label">* </span>请上传【音频格式】为AAC、MP3的音频，文件大小不能超过2M。</div>
										</div>
										<button type="button" class="layui-btn layui-btn-normal uploadAudio" style="margin-top: 10px;">本地上传</button>
										<div class="preview">
											<div class="addFrequency">
												<i class="layui-icon" style="font-size: 30px; color: #333;">&#xe654;</i>
												<p>上传音频</p>
											</div>
											<div class="fileFrequency uploadAudio"></div>
										</div>
<!--										<div class="videoDescribe">-->
<!--											<div class="describe">请添加音频描述</div>-->
<!--											<input type="text" placeholder="请输入...">-->
<!--										</div>-->
									</div>
								</div>
<!--								<div class="set">-->
<!--									<div>-->
<!--										<button type="button" class="layui-btn layui-btn-sm layui-btn-radius layui-btn-normal">提交审核</button>-->
<!--										<button type="button" class="layui-btn layui-btn-sm layui-btn-radius layui-btn-primary">重置内容</button>-->
<!--									</div>-->
<!--								</div>-->
							</div>
							<div class="layui-form-item">
							<h4 class="tips-h4"  id="contentCount" style="display:none;color:#F00">
								短信长度为&nbsp;&nbsp;<span id="contentLength">0</span>&nbsp;&nbsp;,&nbsp;将发送&nbsp;&nbsp;<span id="contentNum">0</span>&nbsp;&nbsp;条短信<span id="thresholdNum"></span>
								<span id="thresholdMsg"></span>
							</h4>
						</div>
						</div>
						<div class="layui-form-item" id="third">
							<div class="layui-inline">
								<label class="layui-btn layui-btn-lg layui-btn-normal" style="cursor:auto;">第三步：项目基站信息选择</label>
							</div>
							<div class="layui-form-item importType">
					                    	<label class="layui-form-label" style="width:120px">基站来源</label>
					                        <div class="layui-input-block">
					                            <input class="radioItem" lay-filter="gis" type="radio" name="importType" title="导入基站" onclick="ChooseRadio(this)" value="1">
												<input class="radioItem" lay-filter="gis" type="radio" name="importType" title="复制其他项目基站" onclick="ChooseRadio(this)" value="2" checked="checked">
												<input class="radioItem" lay-filter="gis" type="radio" name="importType" title="范围选择" onclick="ChooseRadio(this)" value="3">
					                        </div>
					        </div>
					        <div class="layui-form-item copy">
								<div class="layui-inline ">
									<label class="layui-form-label">地市</label>
									<div class="layui-input-block" style="width:150px">
										<select name="cityId_third" lay-filter="cityId_third" id="cityId_third">
											<option value="">请选择</option>
											<option value="11">苏州</option>
											<option value="12">淮安</option>
											<option value="13">宿迁</option>
											<option value="14">南京</option>
											<option value="15">连云港</option>
											<option value="16">徐州</option>
											<option value="17">常州</option>
											<option value="18">镇江</option>
											<option value="19">无锡</option>
											<option value="20">南通</option>
											<option value="21">泰州</option>
											<option value="22">盐城</option>
											<option value="23">扬州</option>
											<option value="25">省级</option>
										</select>
									</div>
								</div>
								<div class="layui-inline countyId">
		                            <label class="layui-form-label">区县</label>
		                            <div class="layui-input-block" style="width:150px">
		                                <select name="countyId_third" lay-filter="countyId_third" id="countyId_third">
		                                    <option value="">全部</option>
		                                </select>
		                            </div>
		                        </div>
		                        <div class="layui-inline mgrId">
		                            <label class="layui-form-label">项目名称</label>
		                            <div class="layui-input-block" style="width:150px">
		                                <select name="mgrId_third" lay-filter="mgrId_third" id="mgrId_third">
		                                    <option value="">请选择</option>
		                                </select>
		                            </div>
		                        </div>
		                                   	<div class="layui-inline">
                            <label class="layui-form-label">项目简称</label>
                            <div class="layui-input-block" style="width:150px">
                                <input type="text"  name="mgrName1" id="mgrName1" lay-verify="required" placeholder="请输入"
                                            autocomplete="off" class="layui-input" />
                            </div>
                        </div>
		                        <div class="layui-inline">
		                            <div class="layui-block">
				                            <button class="layui-btn layui-btn-normal" id="copy">复制</button>
				                            <label id="copyMgrId" style="visibility:hidden;">123</label>
				                	</div>
		                        </div>
							</div>
							<div class="layui-form-item import">
								<br>
								<div class="layui-inline">
									<button type="button" class="layui-btn" id="import">
										<i class="layui-icon"></i>区域基站导入
									</button>
								</div>
								<br class="layui-form-item"> <span><a
									href="/smsBaseStation/apidownload"><u>基站导入帮助手册</u></a></span></br> <span><a
									href="/smsBaseStation/modeldownload"><u>基站导入模板下载</u></a></span>
								<div class="layui-form-item">
										<h4 class="tips-h4">
											<i class="iconfont icon-xinxi"></i>
											请先选择导入的文件再点击提交
										</h4>
								</div>
							</div>
						</div>
						<div class="layui-block">
	                            <button class="layui-btn layui-btn-normal" id="next">下一步</button>
	                	</div>
						<div class="layui-form-item">
							<button class="layui-btn" id="upload2">提交</button>
						</div>
						<div class="layui-form-item">
							<button class="layui-btn" id="upload">提交</button>
						</div>
						<div class="layui-form-item">
							<button class="layui-btn" id="upload3">提交</button>
						</div>
						<div class="layui-form-item" style="display:none;">
							<button class="layui-btn" id="uploadFile">提交</button>
						</div>
					</div>
					<h4 class="tips-h4">
						<i class="iconfont icon-xinxi"></i>
						地市短信项目管理员设置或者修改模板属性提交后短信通知省公司管理员审核，审核通过后设置或者修改属性才能生效
					</h4>
				</div>
			</div>
		</div>
	</div>
</body>
</html>